import _axios from "@/plugins/axios";

let baseUrlPrefix = "/engine/config/datasource"

export const addDatasource = (datasourceConfig) => {
  return _axios.post(baseUrlPrefix + '/add', datasourceConfig)
}

export const fetchDatasourceConfig = (currentPage, pageSize) => {
  return _axios.get(baseUrlPrefix + '/list', {
    "params": {
      currentPage: currentPage,
      pageSize: pageSize
    }
  })
}

export const fetchDatasourceConfigByType = (type) => {
  return _axios.get(baseUrlPrefix + '/getByType', {
    "params": {
      type: type
    }
  })
}
